package com.imooc.pojo;

import com.baomidou.mybatisplus.annotation.*;
import org.springframework.beans.BeanUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.ToString;

/**
 * 轮播图 
 * 
 * @author yukangkang
 * @email 1304473884@qq.com
 * @date 2021-01-16 21:20:11
 */
@Data
@ToString
@TableName("carousel")
public class Carousel implements Serializable {
	private static final long serialVersionUID = 1L;

		/**
		 * 主键
		 */
		@TableId(value = ID, type = IdType.AUTO)
		private String id;
		/**
		 * 图片 图片地址
		 */
		@TableField(IMAGE_URL)
		private String imageUrl;
		/**
		 * 背景色
		 */
		@TableField(BACKGROUND_COLOR)
		private String backgroundColor;
		/**
		 * 商品id 商品id
		 */
		@TableField(ITEM_ID)
		private String itemId;
		/**
		 * 商品分类id 商品分类id
		 */
		@TableField(CAT_ID)
		private String catId;
		/**
		 * 轮播图类型 轮播图类型，用于判断，可以根据商品id或者分类进行页面跳转，1：商品 2：分类
		 */
		@TableField(TYPE)
		private Integer type;
		/**
		 * 轮播图展示顺序
		 */
		@TableField(SORT)
		private Integer sort;
		/**
		 * 是否展示
		 */
		@TableField(IS_SHOW)
		private Integer isShow;
		/**
		 * 创建时间 创建时间
		 */
		@TableField(value = CREATE_TIME,fill = FieldFill.INSERT)
		private Date createTime;
		/**
		 * 更新时间 更新
		 */
		@TableField(value = UPDATE_TIME,fill = FieldFill.INSERT_UPDATE)
		private Date updateTime;




	public final static String ID =  "`id`";
	public final static String IMAGE_URL =  "`image_url`";
	public final static String BACKGROUND_COLOR =  "`background_color`";
	public final static String ITEM_ID =  "`item_id`";
	public final static String CAT_ID =  "`cat_id`";
	public final static String TYPE =  "`type`";
	public final static String SORT =  "`sort`";
	public final static String IS_SHOW =  "`is_show`";
	public final static String CREATE_TIME =  "`create_time`";
	public final static String UPDATE_TIME =  "`update_time`";


	public final static String ID_COMMENT =  "主键";
	public final static String IMAGE_URL_COMMENT =  "图片 图片地址";
	public final static String BACKGROUND_COLOR_COMMENT =  "背景色";
	public final static String ITEM_ID_COMMENT =  "商品id 商品id";
	public final static String CAT_ID_COMMENT =  "商品分类id 商品分类id";
	public final static String TYPE_COMMENT =  "轮播图类型 轮播图类型，用于判断，可以根据商品id或者分类进行页面跳转，1：商品 2：分类";
	public final static String SORT_COMMENT =  "轮播图展示顺序";
	public final static String IS_SHOW_COMMENT =  "是否展示";
	public final static String CREATE_TIME_COMMENT =  "创建时间 创建时间";
	public final static String UPDATE_TIME_COMMENT =  "更新时间 更新";


	public static Carousel of(Object obj) {
		Carousel e = new Carousel();
		BeanUtils.copyProperties(obj, e);
		return e;
	}

	public static QueryWrapper<Carousel> queryWrapper(Object obj) {
		return new QueryWrapper<>(of(obj));
	}



}
